package com.panghl.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Calendar;

@Controller
public class WebController {

    @GetMapping("/")
    public String toIndex(Model model){
        model.addAttribute("userName","panghl111");
        return "index";
    }

    @GetMapping("/login")
    public String toLogin(Model model){
        model.addAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));
        return "login";
    }
}
